use command::setup_handler;
use plugins::setup_plugin;
use std::sync::Mutex;

mod command;
mod hooks;
mod model;
mod plugins;
mod utils;

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    let mut builder = tauri::Builder::default();

    builder = setup_plugin(builder);
    builder = setup_handler(builder);

    builder
        .manage(Mutex::new(model::AppState::new()))
        .setup(hooks::setup)
        .on_page_load(hooks::page_load_handler)
        .on_window_event(hooks::window_event_handler)
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
